import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// 修复路径中的占位符为实际插件名称
export default defineConfig({
  build: {
    lib: {
      entry: './google-sheets.vue', // 改为当前插件的实际路径
      name: 'GoogleSheetsPlugin',
      formats: ['es'],
      fileName: (format) => `google-sheets.${format}.js`
    },
    rollupOptions: {
      external: ['vue'],
      output: {
        globals: {
          vue: 'Vue'
        }
      }
    }
  },
  plugins: [vue()]
})